﻿using AutoMapper;
using B.S.Warehouse.Domain;
using B.S.Warehouse.Domain.goods;
using B.S.Warehouse.Write.Api.Application.Command.AllocateCommand;
using B.S.Warehouse.Write.Api.Application.Command.AllocationDetailsCommand;
using B.S.Warehouse.Write.Api.Application.Command.GoodsCommand;
using B.S.Warehouse.Write.Api.Application.Command.OutboundCommand;
using B.S.Warehouse.Write.Api.Application.Command.OutboundDetailsCommand;
using B.S.Warehouse.Write.Api.Application.Command.StockInApplicationCommand;
using B.S.Warehouse.Write.Api.Application.Command.StockInDetailCommand;
using B.S.Warehouse.Write.Api.Application.Command.WarehouseManagementCommand;
using B.S.Warehouse.Write.Api.Application.Handelr.StockInDetailHandelr;

namespace B.S.Warehouse.Write.Api
{
    public class AutoAppP: Profile
    {
        public AutoAppP()
        {
            //入库管理主表
            CreateMap<AddStockInApplicationCommand, StockInApplication>();
            CreateMap<UpdateStockInApplicationCommand, StockInApplication>();
            CreateMap<DelStockInApplicationCommand, StockInApplication>();

            //入库伸请明细表子表
            CreateMap<AddStockInDetailCommand, StockInDetailS>().ReverseMap();
            CreateMap<DelStockInDetailCommand, StockInDetailS>();
            CreateMap<UpdateStockInDetailCommand, StockInDetailS>();

            //出库管理主表
            CreateMap<AddOutboundDetailsCommand, OutboundDetailss>();
            CreateMap<UpdateOutboundDetailsCommand, OutboundDetailss>();
            CreateMap<DelOutboundDetailsCommand, OutboundDetailss>();

            //出库伸请明细表子表
            CreateMap<AddOutboundCommand, Outbounds>();
            CreateMap<DelOutboundCommand, Outbounds>();
            CreateMap<UpdateOutboundCommand, Outbounds>();

            //仓库管理
            CreateMap<AddStorageAreaCommand, StorageArea>();
            CreateMap<AddStorageLocationCommand, StorageLocation>();
            CreateMap<AddWareHouseCommand, WareHouse>();

            //调拨表
            CreateMap<AddAllocateCommand, Allocate>();
            CreateMap<UpdateAllocateCommand, Allocate>();
            CreateMap<DelAllocateCommand, Allocate>();

            //调拨明细表
            CreateMap<AddAllocationDetailsCommand, AllocationDetails>();
            CreateMap<UpdateAllocationDetailsCommand, AllocationDetails>();
            CreateMap<DelAllocationDetailsCommand, AllocationDetails>();

            //货物信息
            CreateMap<AddGoodsCommand, GoodsModel>();
            CreateMap<UpdateGoodsCommand, GoodsModel>();
            CreateMap<DelGoodsCommand, GoodsModel>();
            CreateMap<StorageArea, UpdateStorageAreaCommand>().ReverseMap();
            CreateMap<StorageLocation, UpdateStorageLocationCommand>().ReverseMap();
            CreateMap<WareHouse, UpdateWareHouseCommand>().ReverseMap();
        }
    }
}
